package com.sdy.healthcode.biz.constants;

import lombok.Getter;
import lombok.Setter;

import java.util.stream.Stream;

public enum HealthStatusType {
    HEALTHY("健康"),
    ILL("有发烧、咳嗽、乏力、肌肉酸痛、呼吸急促、腹泻等症状"),
    OTHER("其他");

    @Getter
    @Setter
    private String type;

    HealthStatusType(String type) {
        this.type = type;
    }

    public static HealthStatusType from(String type) {
        return Stream.of(HealthStatusType.values()).filter(v -> v.type.equals(type)).findAny().orElse(null);
    }
}
